/**
 * @file ParseParam.h
 * @author shikang999@126.com
 * @brief 这个模块主要进行命令行参数解析
 * @version 0.1
 * @date 2025-08-07
 * 
 * @copyright Copyright (c) 2025
 * 
 */
#pragma once
#include <vector>
#include <string>

namespace Parse
{

//1. 参数基本类型
enum class ParamType_E : uint8_t
{
    Int8_E    = 0,
    Int16_E   = 1,
    Int32_E   = 2,
    Int64_E   = 3,
    UInt8_E   = 4,
    UInt16_E  = 5,
    UInt32_E  = 6,
    UInt64_E  = 7,
    Float_E   = 8,
    Double_E  = 9,
    LDouble_E = 10, //long double
    String_E  = 11
};

//2.
struct ParseParam_t
{
    ParseParam_t(const std::string &srcName,
                 const std::string &srcKey,
                 bool srcNeed,
                 ParamType_E srcType,
                 void *srcValue,
                 const std::string &srcNote):name(srcName), key(srcKey), need(srcNeed), type(srcType), value(srcValue), note(srcNote)
    {

    }

    const std::string name;//参数名称
    const std::string key; //参数关键字
    bool need;             //是否必须参数
    ParamType_E type;      //参数类型
    void *value;           //参数地址
    const std::string note;//参数解释

};
using vecParseParam_t = std::vector<ParseParam_t>;

//3.
bool parseParam(char **params, int num, const vecParseParam_t &vecParam);

//4.
void printCmd(const vecParseParam_t &vecParam, const std::string &tip);
}